import time

def sortirovka(a):
    f = open(a + '.txt')
    spisok = [int(el.strip()) for el in f.readlines()]
    f.close()
    start = time.time()
    for i in range(len(spisok) - 1):
        for j in range(len(spisok) - 1 - i):
            if spisok[j] > spisok[j + 1]: 
                spisok[j], spisok[j + 1] = spisok[j + 1], spisok[j]
    finish = time.time()
    t = round((finish - start) * 1000)
    print(a, t, 'milliseconds')
sortirovka('m1_sorted')
sortirovka('m2_reverse')
sortirovka('m3_shuffle')
